home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself Web Publi…sional Reference Edition) / Teach Yourself Web Publishing HTML 3.2.iso / pc / source / chap19 / cgi-bin / pinggen.txt < prev    next >
Encoding:
Text File  |  1996-05-28  |  398 b   |  21 lines

  1. #!/bin/sh
  2. #
  3. # A generic version of the pinglaura script.  Takes one argument indicating 
  4. # the name of the user to ping.
  5.  
  6. echo "Content-type: text/html"
  7. echo
  8. echo "<HTML><HEAD>"
  9. echo "<TITLE>Are You There?</TITLE>"
  10. echo "</HEAD><BODY>"
  11.  
  12. ison=`who | grep "${1}"`
  13.  
  14. if [ ! -z "$ison" ]; then 
  15.     echo "<P>$1 is logged in"
  16. else
  17.     echo "<P>$1 isn't logged in"
  18. fi
  19.  
  20. echo "</BODY></HTML>"
  21.